<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>map</title>
    <script>
        let arr = [-15,26,-33,6];

        //对数组中的每个元素做挨个运算()
        let newResult = arr.map(ele=>ele>0?ele:ele=ele*-1);

        console.log(newResult)
        console.log(arr)


    </script>
</head>
<body>

</body>
</html>